
#include<stdio.h>
#include<stdlib.h>

char * strcpy(char * src){
	if (src==NULL) return NULL;
	char *tmp=src;
	int i=0;
	for(i=0;;i++){
		if(*tmp) tmp++;
		else break;
	}
	char * ret = (char *)malloc(i+1);
	tmp = ret;
	int x;
	for(x=0;x<=i;x++){
		tmp[x]=src[x];
	}
	//x<=i 将src最后一位\x00一起复制
	return ret;
}
int main(){
	char src[100]="啥玩意啊咋回事啊\x00GGGGGGGGG";
	char *s=strcpy(src);
	printf("%s\n",s);
}